package org.example.shop_front_api.service;

import org.example.shop_front_api.entity.User;
import org.example.shop_front_api.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User findByUsernameAndPassword(String username, String password) {
        return userMapper.findByUsernameAndPassword(username, password);
    }

    public User findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    public User getUserWithAddresses(Long userId) {
        return userMapper.getUserWithAddressesByUserId(userId);
    }
}